package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosDsMapper;
import com.ruoyi.net.domain.ElementQosDs;
import com.ruoyi.net.service.IElementQosDsService;

/**
 * 网元-QOS配置-DS域配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosDsServiceImpl implements IElementQosDsService 
{
    @Autowired
    private ElementQosDsMapper elementQosDsMapper;

    /**
     * 查询网元-QOS配置-DS域配置
     * 
     * @param id 网元-QOS配置-DS域配置主键
     * @return 网元-QOS配置-DS域配置
     */
    @Override
    public ElementQosDs selectElementQosDsById(String id)
    {
        return elementQosDsMapper.selectElementQosDsById(id);
    }

    /**
     * 查询网元-QOS配置-DS域配置列表
     * 
     * @param elementQosDs 网元-QOS配置-DS域配置
     * @return 网元-QOS配置-DS域配置
     */
    @Override
    public List<ElementQosDs> selectElementQosDsList(ElementQosDs elementQosDs)
    {
        return elementQosDsMapper.selectElementQosDsList(elementQosDs);
    }

    /**
     * 新增网元-QOS配置-DS域配置
     * 
     * @param elementQosDs 网元-QOS配置-DS域配置
     * @return 结果
     */
    @Override
    public int insertElementQosDs(ElementQosDs elementQosDs)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosDs.getId())) {
            elementQosDs.setId(uuid);
        }
        elementQosDs.setCreateBy(SecurityUtils.getUsername());
        elementQosDs.setCreateTime(DateUtils.getNowDate());
        elementQosDs.setUpdateBy(SecurityUtils.getUsername());
        elementQosDs.setUpdateTime(DateUtils.getNowDate());
        return elementQosDsMapper.insertElementQosDs(elementQosDs);
    }

    /**
     * 修改网元-QOS配置-DS域配置
     * 
     * @param elementQosDs 网元-QOS配置-DS域配置
     * @return 结果
     */
    @Override
    public int updateElementQosDs(ElementQosDs elementQosDs)
    {
        elementQosDs.setUpdateBy(SecurityUtils.getUsername());
        elementQosDs.setUpdateTime(DateUtils.getNowDate());
        return elementQosDsMapper.updateElementQosDs(elementQosDs);
    }

    /**
     * 批量删除网元-QOS配置-DS域配置
     * 
     * @param ids 需要删除的网元-QOS配置-DS域配置主键
     * @return 结果
     */
    @Override
    public int deleteElementQosDsByIds(String[] ids)
    {
        return elementQosDsMapper.deleteElementQosDsByIds(ids);
    }

    /**
     * 删除网元-QOS配置-DS域配置信息
     * 
     * @param id 网元-QOS配置-DS域配置主键
     * @return 结果
     */
    @Override
    public int deleteElementQosDsById(String id)
    {
        return elementQosDsMapper.deleteElementQosDsById(id);
    }
}
